package com.sky.mapper;

import com.sky.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {
    //批量插入菜品数据
    void insertBatch(List<SetmealDish> setmealDishes) ;

    //根据菜品id查询对应的套餐数据
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);


    //根据id查询对应的菜品数据
    @Select("select *from setmeal_dish where setmeal_id=#{dishId}")
    List<SetmealDish> getDishId(Long dishId);

    //根据套餐id删除对应的菜品数据
    @Delete("delete from setmeal_dish where setmeal_id=#{dishId}")
    void deleteByDishId(Long dishId);
}
